package apresentacao;

import java.awt.Font;
import java.awt.Frame;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Rectangle;

import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import ferramentas.Tools;

public class SobreSistema  extends JDialog
{	
	private String nomeFrame;
	private JButton btnFechar;
	private Icon icoFec = null;
	private JLabel lblVersao;
	private String versao;

	private JButton btnFechar2;
	
	public SobreSistema(Frame owner, boolean modal,String titulo, String versao) 
	{
		super(owner, modal); 
		nomeFrame = titulo;
		this.versao = versao;
		initialize();
	}
	
	private void initialize()
	{    
		this.setSize(600, 350);
		Tools.centerWindow(this);
		this.setResizable(false);
		this.setUndecorated(true);
		this.setTitle("Cadastro de " + nomeFrame);
		nomeFrame = Tools.removeAcentos(nomeFrame);
		this.setLayout(null);
		
		
        try 
        {
        	JMeuPainel logo1 = new JMeuPainel();
        	logo1.setBounds(0,0,600,350);
        	add(logo1);	        
	
        	icoFec = new ImageIcon(getClass().getResource("/imagens/ok.png")); 
        	btnFechar = new JButton("Fechar",icoFec);
        	btnFechar.setBounds(new Rectangle(5, 320, 120, 25));
        	add(btnFechar);
        	
        }
        catch (Exception ex) 
        {   

        }   
        

		
	    btnFechar.addActionListener(new java.awt.event.ActionListener() 
	    {  
			public void actionPerformed(java.awt.event.ActionEvent evt) 
			{
				setVisible(false);
			}
		});	
	}
	
	public class JMeuPainel extends JPanel
	{

		Image im = new ImageIcon ( getClass ( ).getResource ( "/imagens/Logo1.png" ) ).getImage ( );

		public void paintComponent ( Graphics g )
		{
			super.paintComponent ( g );
			int x = ( this.getWidth ( ) - im.getWidth ( null ) ) / 2;
			int y = ( this.getHeight ( ) - im.getHeight ( null ) ) / 2;
			g.drawImage ( im , x , y , this );
		}
	}
}


